/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package diet.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author BadBoy
 */
public class DietDetailDTO implements java.io.Serializable {

    private int DietDetailID;
    private int DietID;
    private int DishID;
    private String Time;
    private Date DateTime;

    /**
     * @return the DietDetailID
     */
    public int getDietDetailID() {
        return DietDetailID;
    }

    /**
     * @param DietDetailID the DietDetailID to set
     */
    public void setDietDetailID(int DietDetailID) {
        this.DietDetailID = DietDetailID;
    }

    /**
     * @return the DietID
     */
    public int getDietID() {
        return DietID;
    }

    /**
     * @param DietID the DietID to set
     */
    public void setDietID(int DietID) {
        this.DietID = DietID;
    }

    /**
     * @return the DishID
     */
    public int getDishID() {
        return DishID;
    }

    /**
     * @param DishID the DishID to set
     */
    public void setDishID(int DishID) {
        this.DishID = DishID;
    }

    /**
     * @return the Time
     */
    public String getTime() {
        return Time;
    }

    /**
     * @param Time the Time to set
     */
    public void setTime(String Time) {
        this.Time = Time;
    }

    /**
     * @return the DateTime
     */
    public Date getDateTime() {
        return DateTime;
    }

    /**
     * @param DateTime the DateTime to set
     */
    public void setDateTime(Date DateTime) {
        this.DateTime = DateTime;
    }

    public DietDetailDTO() {
        this.DietDetailID = 0;
        this.DietID = 0;
        this.DishID = 0;
        this.Time = "";

        final int year = Calendar.getInstance().get(Calendar.YEAR);
        int month = Calendar.getInstance().get(Calendar.MONTH);
        int date = Calendar.getInstance().get(Calendar.DATE);
        String dateString = Integer.toString(year) + "-" + Integer.toString(month) + "-" + Integer.toString(date);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

//        try {
            // this.DateTime = dateFormat.parse(dateString);
            this.DateTime = new Date();
//        } catch (ParseException ex) {
//            this.DateTime = null;
//        }
    }
}
